home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / text / faqs / aix-faq.part2 < prev    next >
Encoding:
Internet Message Format  |  1994-05-08  |  64.2 KB

  1. Subject: AIX Frequently Asked Questions (Part 2 of 3)
  2. Newsgroups: comp.unix.aix,comp.answers,news.answers
  3. From: jwarring@fmsaix.amsinc.com (Jeff Warrington)
  4. Date: 06 May 1994 23:47:00 GMT
  5.  
  6. Archive-name: aix-faq/part2
  7. Last-modified: May 6, 1994
  8. Version: 3.10
  9.  
  10.  
  11. Version: $Id: faq.2,v 1.2 1994/05/06 23:28:54 jwarring Exp $
  12.  
  13. Frequently Asked Questions to AIX 3.x and IBM RS/6000
  14. _____________________________________________________
  15.  
  16. 1.201: How do I do remote backup?
  17.  
  18. There seems to be several ways of doing this. I found the following works:
  19.  
  20.   tar -b1 -cf - . | rsh REMOTEHOST "dd ibs=512 obs=1024 of=/dev/TAPEDEVICE"
  21.  
  22.  
  23. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  24.  
  25. mksysb will not back up to remote tape devices. The following script
  26. will do remote backups.
  27.  
  28. [Ed.: I've verified this script works fine. However, it may be slow for
  29.  large filesystems since it creates a temp file of filenames in /tmp.]
  30.  
  31. #!/bin/ksh
  32. # @(#) Create a backup tape of the private user data.
  33. #=================================================================#
  34. #   Script :  usave.sh                                            #
  35. #   Author :  F. Kraemer                                          #
  36. #   Date   :  92/02/19                                            #
  37. #   Update :  92/10/29                                            #
  38. #   Info   :  the ultimative backup script                        #
  39. #   Example:  usave.sh /dev/rmt0      -  save to local tape       #
  40. #             usave.sh /save/save.me  -  save to local file       #
  41. #             usave.sh /tmp/pipe      -  save to remote tape      #
  42. #-----------------------------------------------------------------#
  43. PS4="(+) "
  44. #set -x
  45. PROG=$(basename $0)
  46. HOST=$(hostname)
  47. TODAY=$(date +%H:%M:%S)
  48. #
  49. # cleanup
  50. #
  51. cleanup ()
  52. {
  53. ec=$1
  54. error=$2
  55. case "$ec"
  56. in
  57.    "$USAGE_EC")    # usage error
  58.      error="Usage:\t$PROG DeviceName\n" 1>&2
  59.     ;;
  60.    "$NOTAP_EC")    # Tape error
  61.      error="error:\t$PROG: $DEVICE is not available on the system.\n" 1>&2
  62.     ;;
  63.    "$LISTE_EC")    # list error
  64.      error="error:\t$PROG: could not create tar list for $LOGNAME.\n" 1>&2
  65.     ;;
  66.    "$NOTAR_EC")    # tar command error
  67.      error="error:\t$PROG: tar command failed.\n" 1>&2
  68.     ;;
  69.    "$PIPEP_EC")    # pipe error
  70.      error="error:\t$PROG: mknod command failed.\n" 1>&2
  71.     ;;
  72.    "$NORSH_EC")    # rsh error
  73.      error="error:\t$PROG: rsh - Remote Shell command failed.\n" 1>&2
  74.     ;;
  75.    "$RHOST_EC")    # remote host error
  76.      error="error:\t$PROG: Remote Host unknown.\n" 1>&2
  77.     ;;
  78.    *)
  79.    ;;
  80. esac
  81. case "$DEVICE"
  82. in
  83.     #
  84.     # Fix the block size if $DEVICE is a tape device
  85.     #
  86.     /dev/rmt[0-9]*)
  87.         echo "\n\t$PROG: Rewinding tape to begin.........(please wait)\n"
  88.         tctl -f $DEVICE rewind 2>/dev/null
  89.         ;;
  90.     *) ;;
  91. esac
  92. rm -f ${LIST} ${PIPE} 2>/dev/null
  93. [ -n "$error" ] && echo "\n${error}\n"
  94. trap '' 0 1 2 15
  95. exit "$ec"
  96. }
  97. #
  98. # Variables
  99. #
  100. USAGE_EC=1                         # exit code for usage error
  101. NOMNT_EC=2                         # exit code wrong device name
  102. NOTAP_EC=3                         # exit code no tape available
  103. LISTE_EC=4                         # exit code backup list error
  104. NOTAR_EC=5                         # exit code for wrong tar
  105. TRAPP_EC=6                         # exit code for trap
  106. PIPEP_EC=7                         # exit code for pipe
  107. RHOST_EC=8                         # exit code for bad ping
  108. NORSH_EC=9                         # exit code for bad rsh
  109. DEVICE="$1"                        # device to tar into
  110. LIST="/tmp/.tar.$LOGNAME.$$"       #
  111. REMOTEH=""                         # Remote host for backup
  112. REMOTET=""                         # Remote tape for backup
  113. tapedev=                           #
  114. PIPE="/tmp/pipe"                   # Pipe for remote backup
  115. #
  116. # main()
  117. #
  118. tput clear
  119. echo "\n\t$PROG started from $LOGNAME@$HOST on $TERM at $TODAY.\n"
  120. rm -f $LIST 2>/dev/null
  121. #
  122. # Trap on exit/interrupt/break to clean up
  123. #
  124. trap "cleanup $TRAPP_EC \"Abnormal program termination. $PROG"\"  0 1 2 15
  125. #
  126. # Check command options
  127. #
  128. [ "$#" -ne 1 ]  &&  cleanup "$USAGE_EC" ""
  129. #
  130. # Check device name
  131. #
  132. [ `expr "$DEVICE" : "[/]"` -eq 0 ] && cleanup "$NOMNT_EC" \
  133.         "$PROG: Backup device or file name must start with a '/'."
  134. #
  135. # Check tape device
  136. #
  137. case "$DEVICE"
  138. in
  139.     #
  140.     # Fix the block size if $DEVICE is a tape device
  141.     #
  142.     /dev/rmt[0-9]*)
  143.         #
  144.         echo "\n\t$PROG: Verify backup media ($DEVICE)............\n"
  145.         #
  146.         # see if a low or high density tape device was specified
  147.         # (eg rmt0.1)
  148.         density="`expr $DEVICE : \
  149.                 "/dev/rmt[0-9]*\.\([0-9]*\)"`"
  150.         #
  151.         # strip /dev/ from device name and
  152.         # get the base name (eg translate:
  153.         # /dev/rmt0.2 to rmt0)
  154.         #
  155.         tapedev="`expr $DEVICE : \
  156.                 "/dev/\(rmt[0-9]*\)[\.]*[0-9]*"`"
  157.         #
  158.         # Check if the tape is defined in the system.
  159.         lsdev -C -c tape -S Available -F "name" | grep $tapedev >/dev/null 2>&1
  160.         rc=$?
  161.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  162.         #
  163.         # Restore old tape name.
  164.         #
  165.         [ "${density:-1}" -lt 4 ] && density=1 || density=5
  166.         DEVICE="/dev/${tapedev}.${density}"
  167.         echo "\n\t$PROG: Insert a tape in ($DEVICE)........(press enter)\n"
  168.         read TEMP
  169.         echo "\n\t$PROG: Rewinding tape to begin...........(please wait)\n"
  170.         tctl -f $DEVICE rewind 2>/dev/null
  171.         ;;
  172.     #
  173.     # Backup is done on remote host. The remote shell facility
  174.     # must be set up and running.
  175.     #
  176.     ${PIPE}*)
  177.         #
  178.         echo "\n\t$PROG: Assuming remote backup via network.\n"
  179.         echo "\t$PROG: Enter name of Remote Host   ===> \c"
  180.         read REMOTEH
  181.         echo "\n\t$PROG: Pinging Remote Host to test connection.\n"
  182.         ping ${REMOTEH} 1 1 >/dev/null 2>&1
  183.         rc=$?                                    # give up unknown host
  184.         [ "$rc" -ne 0 ] && cleanup "$RHOST_EC" ""
  185.         JUNK=$(rsh ${REMOTEH} "/usr/sbin/lsdev -C -c tape -S Available")
  186.         rc=$?                                    # give up rsh failed
  187.         [ "$rc" -ne 0 ] && cleanup "$NORSH_EC" ""
  188.         echo "\t$PROG: Available Tapes on ${REMOTEH} are :\n\n\t\t${JUNK}\n"
  189.         echo "\t$PROG: Enter name of Remote Tape (e.g. /dev/rmt0) ===> \c"
  190.         read REMOTET
  191.         echo "\n\t$PROG: Insert tape on ${REMOTEH} in ${REMOTET}..(press enter)"
  192.         read TEMP
  193.         echo "\t$PROG: Rewinding Remote Tape ${REMOTET} on ${REMOTEH}.\n"
  194.         rsh ${REMOTEH} "tctl -f ${REMOTET} rewind"
  195.         rc=$?                                    # give up rsh failed
  196.         [ "$rc" -ne 0 ] && cleanup "$NOTAP_EC" ""
  197.         rm -f ${PIPE} 2>/dev/null
  198.         mknod ${PIPE} p
  199.         rc=$?                                    # give up mknod failed
  200.         [ "$rc" -ne 0 ] && cleanup "$PIPEP_EC" ""
  201.         cat ${DEVICE} | rsh ${REMOTEH} "dd of=${REMOTET} obs=100b 2>/dev/null" &
  202.         ;;
  203.     *)  ;;
  204. esac
  205. #
  206. # Prepare the list
  207. #
  208. echo "\n\t$PROG: Create list of files to be saved...."
  209. find $HOME -print > $LIST
  210. rc=$?
  211. [ "$rc" -ne 0 ] &&  cleanup "$LISTE_EC" ""
  212. #
  213. # tar the files
  214. #
  215. echo "\n\t$PROG: Changing current directory to (/)...."
  216. cd / > /dev/null 2>&1
  217. echo "\n\t$PROG: Running tar format backup from user ($LOGNAME)...."
  218. tar -cvf "$DEVICE" -L "$LIST"
  219. rc="$?"
  220. [ "$rc" -ne 0 ]  && cleanup "$NOTAR_EC" ""
  221. #
  222. # Backup completed
  223. #
  224. TODAY=$(date +%H:%M:%S)
  225. echo "\n\t$PROG ended at $TODAY............................\n\n"
  226. cleanup 0
  227.  
  228.  
  229. 1.202: How do I backup a multi-disk volume group?
  230. From: pack@acd.ucar.edu (Daniel Packman)
  231.  
  232. [ Ed.: I have not verified this procedure. I would actually recommend
  233.   NOT to have one volume group span multiple disks unless you really
  234.   need such big logical volumes. ]
  235.  
  236.   1. If you have a set of three or more disks in a volume group
  237.      (typically 3 for 5xx machines with three internal drives;
  238.      with only two, the procedures outlined here have to be modified
  239.      to ignore the fact that you don't have a quorum in the volume group)
  240.  
  241.   2. If one drive has failed (usually only one fails at a time :-) )
  242.  
  243. It is possible to go through a service boot (the volume group is called
  244. rootvg and one of the 2 good disks on it is called hdisk0):
  245.  
  246.   importvg -y rootvg hdisk0
  247.   varyonvg -f -n -m1 rootvg
  248.  
  249. These commands will work, but give error messages. If you wish to mount
  250. a user filesystem, say /u on logical volume /dev/lv00, then
  251.  
  252.   mount -f /dev/lv00 /v
  253.  
  254. will work only if jfslog, the journaled file system log device, is not
  255. on the damaged disk. If it is, you must (and can in any case) mount the
  256. filesystem read-only:
  257.  
  258.   mount -f -r /dev/lv00 /v
  259.  
  260. This crucial and rather obvious point baffled several level 3 support
  261. personnel at Austin as well as myself for almost a week. Once the file
  262. system(s) of interest are available, they can be saved to tape for
  263. restoration later. Of course, one can expect only about two thirds of a
  264. filesystem to be recoverable if it spans all 3 physical disks. One
  265. other point to remember is that the standard boot procedure from floppy
  266. includes the restore command but does not include the backup command.
  267.  
  268. *****************************************************************************
  269. * If you do not have other RS6000 machines at your site it is imperative    * 
  270. * that you either build a bootable tape which includes either restore or    * 
  271. * tar or cpio (a bootable floppy set will not have enough space) or at the  *
  272. * very least copy onto a spare floppy backup, cpio, or tar.  The floppy     *
  273. * should be created with backup -ivq so that its contents can be read into  *
  274. * the memory resident system after booting.                                 *
  275. *****************************************************************************
  276.  
  277. All is not lost if tar, cpio or backup are available on an undamaged
  278. disk that can be mounted. Since tar and cpio are in /bin, they may both
  279. very well be unavailable.
  280.  
  281. It is a very good idea for those who have tape devices to build a
  282. bootable tape with their desired extra commands in it. Follow the
  283. instructions from IBM but add your desired commands to the following
  284. three files:
  285.  
  286.     /usr/lpp/bosinst/tape2
  287.     /usr/lpp/bosinst/diskette/boot2
  288.     /usr/lpp/bosinst/diskette/inslist
  289.  
  290. If you have anything other than a minimum memory configuration, you
  291. should be able to add many commands.
  292.  
  293.  
  294. 1.203: How do I put multiple backups on a single 8mm tape?
  295. From: kerm@mcnc.org (Cary E. Burnette)
  296.  
  297. There are two possible solutions to this, both of which use /dev/rmt0.1
  298. which is non-rewinding.
  299.  
  300. SOLUTION #1
  301. -----------
  302.  
  303. To put multiple backups on a single tape, use /dev/rmt0.1, which is a
  304. no-rewind device, using either rdump or backup (both by name & inode
  305. work). Using rdump or backup "byinode" both generate the message that
  306. the tape is rewinding but actually do not. This is an example that
  307. works on my system:
  308.  
  309. # rsh remote1 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  310. # rsh remote2 -l root /etc/rdump host:/dev/rmt0.1 -Level -u /u
  311. # tctl -f /dev/rmt0.1 rewind       # rewinds the tape
  312.  
  313. where I am implementing the command from host.
  314. To restore a table of contents of the first I would use 
  315.  
  316. # restore -f /dev/rmt0.1 -s1 -tv
  317.  
  318. where the -s1 flag tells restore to go to the first record on the tape. 
  319. Type the exact command again to get the second record. The -s(Number)
  320. means go to Number record from this spot. It works pretty well.
  321.  
  322.  
  323. SOLUTION #2
  324. -----------
  325.  
  326. Steve Knodle
  327. Educational Resources Center
  328. Clarkson University
  329.  
  330. I use:
  331. ------------------- Dump.sh --------------------
  332. CONTENTSFILE=`date |dd conv=lcase |sed -e 's/19//' |awk '{print $6 $2 $3}'`
  333. set -x
  334. LEVEL=$1
  335. shift
  336.  
  337. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /
  338. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /usr
  339. backup -c -b 56 -$LEVEL -uf /dev/rmt0.1 /u
  340. tctl -f /dev/rmt0 rewind
  341.  
  342. touch /usr/local/dumps/Contents.$CONTENTSFILE
  343. echo "Dumping /" >>/usr/local/dumps/Contents.$CONTENTSFILE
  344. restore -t -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  345. echo "Dumping /usr" >>/usr/local/dumps/Contents.$CONTENTSFILE
  346. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  347. echo "Dumping /u" >>/usr/local/dumps/Contents.$CONTENTSFILE
  348. restore -t -q -s 1 -f /dev/rmt0.1 >>/usr/local/dumps/Contents.$CONTENTSFILE
  349. tctl -f /dev/rmt0 rewind
  350.  
  351. I process the table-of-contents first by a little program that does
  352. common prefix encoding, and then compress.
  353.  
  354. This gives a table of contents file I can keep on-line until the tape
  355. is reused.
  356.  
  357.  
  358. 1.204: How can I make an exact duplicate of a tape over the network?
  359.  
  360. The challenge here is not to have to create a temporary file (disk space
  361. limitation) and work across heterogeneous networks.
  362.  
  363. This script might work:
  364.  
  365. LOCAL=/dev/tape_dev
  366. REMOTE=/dev/tape_dev
  367. dd if=$LOCAL ibs=64k obs=512 | rsh remote_host dd ibs=512 obs=64k of=$REMOTE
  368.  
  369.  
  370. From: pack@acd.ucar.edu (Daniel Packman)
  371.  
  372. Daniel provides the following perl script to convert from the known
  373. world's function codes to AIX for compatibility.
  374.  
  375. #!/bin/perl
  376. # Wrapper to convert input rmt requests to
  377. # AIX 3.2 ioctl numbers.  We pass on all commands we don't understand
  378. # I0 MTWEOF -> I10  STWEOF write and end-of-file record
  379. # I1 MTFSF  -> I11  STFSF  forward space file
  380. # I2 MTBSF  -> I12  STRSF  reverse space file
  381. # I3 MTFSR  -> I13  STFSR  forward space record
  382. # I4 MTBSR  -> I14  STRSR  reverse space record
  383. # I5 MTREW  -> I6   STREW  rewind
  384. # I6 MTOFFL -> I5   STOFFL rewind and unload tape
  385. # I7 MTNOP  -> I0   (no-op? should ignore following count)
  386. # I8 MTRETEN-> I8   STRETEN retension tape, leave at load point
  387. # I9 MTERASE-> I7   STERASE erase tape, leave at load point
  388. #I10 MTEOM (position to end of media ... no ibm equivalent?)
  389. #I11 MTNBSF  (backward space file to BOF ... no ibm equivalent?)
  390. @iocs = (10,11,12,13,14,6,5,0,8,7);
  391. open(RMT,"|/usr/sbin/rmt") || die "Can't open pipe to rmt\n";
  392. select(RMT);
  393. $| = 1;
  394. while (<STDIN>) {
  395.   s/(^I)(\d$)/I$iocs[$2]/;
  396.   exit 0 if $_ =~ /^[Qq]/;
  397.   print RMT $_ ; }
  398. exit 0;
  399.  
  400.  
  401. 1.205: What is tape block size of 0?
  402. From: benson@odi.com (Benson I. Margulies)
  403.  
  404. Tape devices are generally split into two categories: fixed block and
  405. variable block.  1/4" tape is the fixed block, and 8mm is variable.
  406.  
  407. On a fixed block size device, the kernel always sends data to the device
  408. in suitable block size lumps, and varying the size passed to write(2)
  409. (e.g., via the bs option to dd) gives the kernel more data to stream. 
  410. On a variable block size device, the kernel writes to the device
  411. whatever passed to it. On an 8mm, it had better be a multiple of 1024
  412. to get efficient tape usage.
  413.  
  414. AIX has the World's Only Variable Block Size 1/4" tape drive. If you
  415. use SMIT to set the block size to a nonzero value, AIX treats the device
  416. as fixed block size, whether it is or not. By default, 8mm drives are
  417. set to the same size as 1/4", 512 bytes. This is wasteful, but
  418. otherwise mksysb and installp would fail.
  419.  
  420. If you set the block size to 0, the device is treated as variable block
  421. size, and the size passed to write becomes the physical block size. 
  422. Then if you use a sensible block size to dd, all should be wonderful.
  423.  
  424.  
  425. 1.206: Resetting a hung tape drive
  426. From: Craig_Anderson@kcbbs.gen.nz (Craig Anderson)
  427.  
  428. A process accesses the tape drive. The process stops, exits, or whatever,
  429. but still hold on to the drive. When this happens, the process cannot be
  430. killed by any signal and the tape drive cannot be used by any other
  431. process until the machine is rebooted.
  432.  
  433. The following should help:
  434.  
  435. RESET:
  436.  
  437. AIX, like most UNIX systems has no reset function for tape drives. You
  438. can however send a Bus Device Reset (a standard SCSI message) to the
  439. tape drive using the following piece of code. If the tape drive does
  440. not respond to the BDR, then a SCSI Bus Reset will be sent (and this
  441. will reset every device on the SCSI Bus). SCSI Bus resets are rather
  442. extreme so you should refrain from using this program unnecessarily. 
  443. But there are times (like after you've inserted a jammed/old/bad tape in
  444. an 8mm drive), when there's no other way to reset the device other than
  445. to shutdown and reboot (obviously you can power down and up an external
  446. drive to reset it - and this would be the better choice).
  447.  
  448. This is actually documented in info, but can be hard to find and
  449. there's no complete program.
  450.  
  451. /* taperst: resets the tape drive by sending a BDR to the drive. */
  452. #include <stdio.h>
  453. #include <fcntl.h>
  454. #include <errno.h>
  455. #include <sys/scsi.h>
  456.  
  457. int main(int argc, char **argv)
  458. {
  459.          /* This can be run only by root */
  460.  
  461.          if (argc != 2) {
  462.              fprintf(stderr, "Usage: %s /dev/rmt#\n", argv[0]);
  463.              return 1;
  464.          }
  465.  
  466.          if (openx(argv[1], O_RDONLY, 0, SC_FORCED_OPEN) < 0) {
  467.              perror(argv[0]);
  468.              return 2;
  469.          }
  470.          return 0;
  471. }
  472.  
  473. 1.207: How do I read a mksysb tape with tar?
  474. From: Marc Pawliger (marc@sti.com)
  475.  
  476. To recover specific files from a backup made with mksysb, try
  477. $ tctl fsf 3
  478. $ tar xvf/dev/rmt0.1 ./your/file/name
  479.  
  480. ______________________________________________________________________________
  481. 1.300: Some info about the memory management system
  482. From: Michael Coggins (MCOG@CHVM1.VNET.IBM.COM).
  483.  
  484. 1. Does AIX use more paging space than other unix systems?
  485.  
  486. Under many scenarios, AIX requires more paging space than other unix
  487. systems. The AIX VMM implements a technique called "early allocation of
  488. paging space". When a page is allocated in RAM, and it is not a
  489. "client" (NFS) or a "persistent" (disk file) storage page, then it is
  490. considered a "working" storage page. Working storage pages are commonly
  491. an application's stack, data, and any shared memory segments. So, when
  492. a program's stack or data area is increased, and RAM is accessed, the
  493. VMM will allocate space in RAM and space on the paging device. This
  494. means that even before RAM is exhausted, paging space is used. This
  495. does not happen on many other unix systems, although they do keep track
  496. of total VM used.
  497.  
  498. Example 1: 
  499. Workstation with 64mb RAM is running only one small application that
  500. accesses a few small files. Everything fits into RAM, including all
  501. accessed data. On AIX, some paging space will already be used. On
  502. other unix systems, paging space will be 100% free. Clearly, this is an
  503. example that shows where we use more paging space than the other machines.
  504.  
  505. Example 2:
  506.  
  507. Same machine as above, except we are in an environment where many
  508. applications are running with inadequate RAM. Also, the system is
  509. running applications that are started, run, left idle, and not in
  510. constant use. A session of FRAME running in a window, for example. 
  511. What happens is that eventually (theoretically) all applications will be
  512. paged out at least once. On the AIX system and the other systems the
  513. total paging requirements will be the same (assuming similar malloc
  514. algorithm). The major difference is that the AIX system allocated the
  515. paging space pages before they were actually needed, and the other
  516. systems did not allocate them until they were needed. However, most
  517. other systems have an internal variable that gets incremented as virtual
  518. memory pages are used. AIX does not do this. This can cause the AIX
  519. system to run out of paging space (virtual memory), even though malloc()
  520. continues to return memory. This "feature" allows sparse memory
  521. segments to work, but requires that all normal users of malloc()
  522. (sbrk()) know how much virtual memory will be available (actually
  523. impossible), and to handle a paging space low condition. A big problem. 
  524. There are some pretty obvious pros and cons to both methods of doing
  525. Virtual Memory.
  526.  
  527. 2. How much paging space do I need?
  528.  
  529. Concerning the rule of thumb of having 2 times RAM for paging space:
  530. this is rather simplistic, as are most rules of thumb.  If the machine
  531. is in a "persistent storage environment", meaning that they have a few
  532. small programs, and lots of data, they may not need even as much as 1
  533. times RAM for paging space.  For example, a 1GB database server running
  534. on a 6000 with 256MB of RAM, and only running about 50MB of "working"
  535. storage does not need 512MB of paging space, or even 256MB.  They only
  536. need the amount of paging space that will allow all their working
  537. storage to be paged out to disk.  This is because the 1GB database is
  538. mostly "persistent storage", and will require little or no paging space. 
  539. Excessive paging space may simply mean wasted disk space.  However,
  540. avoid insufficient paging space.  Tip: Don't have more than one paging
  541. space per disk.  Tip: Put lots of RAM in your system - it will use it.
  542.  
  543. 3. Why does vmstat show no free RAM pages?
  544.  
  545. AIX uses RAM as a possibly huge disk buffer.  If you read a file in the
  546. morning, that file is read into RAM, and left there.  If no other
  547. programs need that RAM, that file will be left in RAM until the machine
  548. is halted.  This means that if you need the file again, access will be
  549. quick.  If you need that RAM, the system will simply use the pages the
  550. file were using. The pages were flushed back to disk earlier.  This
  551. means that you can get a huge speedup in disk access if you have enough
  552. RAM.  For example, a 200MB database will just ease into RAM if you have
  553. a 256MB system.
  554.  
  555. 4. Since vmstat shows no free RAM pages, am I out of RAM?
  556.  
  557. Probably not. Since disk files will be "mapped" into RAM, if vmstat
  558. shows lots of RAM pages FREE, then you probably have too much RAM (not
  559. usual on a RISC System/6000)!
  560.  
  561. 5. Shouldn't the "avm" and the "fre" fields from vmstat add up to something?
  562.  
  563. No. The "avm" field tells you how much "Active Virtual Memory" AIX
  564. thinks you are using. This will closely match the amount of paging
  565. space you are using. This number has *ABSOLUTELY* nothing to do with
  566. the amount of RAM you are using, and does *NOT* include your mapped
  567. files (disk files).
  568.  
  569. 6. Why does the "fre" field from vmstat sometimes show lots of free
  570.    RAM pages?
  571.  
  572. This will happen after an application that used a lot of RAM via
  573. "working" storage (not NFS storage, and not disk file or "persistent"
  574. storage) exits. When RAM pages that were used by working storage (a
  575. program's stack and data area) are no longer needed, there is no need to
  576. leave them around. AIX completely frees these RAM pages. The time to
  577. access these pages versus a RAM page holding a "sync'd" mapped file is
  578. almost identical. Therefore, there is no need to periodically "flush" RAM.
  579.  
  580. 7. Is the vmstat "fre" field useful?
  581.  
  582. The vmstat "fre" field represents the number of free page frames.  If
  583. the number is consistently small (less than 500 pages), this is normal. 
  584. If the number is consistently large (greater than 4000 pages), then you
  585. have more memory than you need in this machine.
  586.  
  587.  
  588. 1.301: How much should I trust the ps memory reports?
  589. From: chukran@austin.VNET.IBM.COM
  590.  
  591. Using "ps vg" gives a per process tally of memory usage for each running
  592. process.  Several fields give memory usage in different units, but these
  593. numbers do not tell the whole story on where all the memory goes.
  594.  
  595. First of all, the man page for ps does not give an accurate description
  596. of the memory related fields.  Here is a better description:
  597.  
  598. RSS - This tells how much RAM resident memory is currently being used
  599. for the text and data segments for a particular process in units of
  600. kilobytes.  (this value will always be a multiple of 4 since memory is
  601. allocated in 4 KB pages).
  602.  
  603. %MEM - This is the fraction of RSS divided by the total size of RAM for
  604. a particular process.  Since RSS is some subset of the total resident
  605. memory usage for a process, the %MEM value will also be lower than actual.
  606.  
  607. TRS - This tells how much RAM resident memory is currently being used
  608. for the text segment for a particular process in units of kilobytes. 
  609. This will always be less than or equal to RSS.
  610.  
  611. SIZE - This tells how much paging space is allocated for this process
  612. for the text and data segments in units of kilobytes.  If the executable
  613. file is on a local filesystem, the page space usage for text is zero. 
  614. If the executable is on an NFS filesystem, the page space usage will be
  615. nonzero.  This number may be greater than RSS, or it may not, depending
  616. on how much of the process is paged in.  The reason RSS can be larger is
  617. that RSS counts text whereas SIZE does not.
  618.  
  619. TSIZ - This field is absolutely bogus because it is not a multiple of 4
  620. and does not correlate to any of the other fields.
  621.  
  622. These fields only report on a process text and data segments.  Segment
  623. size which cannot be interrogated at this time are:
  624.  
  625.        Text portion of shared libraries (segment 13)
  626.  
  627.        Files that are in use. Open files are cached in memory as
  628.        individual segments.  The traditional kernel cache buffer
  629.        scheme is not used in AIX 3.
  630.  
  631.        Shared data segments created with shmat.
  632.  
  633.        Kernel segments such as kernel segment 0, kernel extension
  634.        segments, and virtual memory management segments.
  635.  
  636. Speaking of kernel segments, the %MEM and RSS report for process zero
  637. are totally bogus for AIX 3.1.  The reason why RSS is so big is that the
  638. kernel segment zero is counted twice.  For AIX 3.2, this has been
  639. changed, but the whole story is still not known.  The RSS value for
  640. process 0 will report a very small number of the swapper private data
  641. segment.  It does not report the size of the kernel segment 0, where the
  642. swapper code lives.
  643.  
  644. In summary, ps is not a very good tool to measure system memory usage. 
  645. It can give you some idea where some of the memory goes, but it leaves
  646. too many questions unanswered about the total usage.
  647.  
  648. ______________________________________________________________________________
  649. 1.400: How do I make an informative prompt in the shell?
  650.  
  651. In the Korn Shell (ksh), the PS1 variable is expanded each time it is
  652. printed, so you can use:
  653.  
  654. $ myhost=`hostname`
  655. $ PS1='$LOGNAME@$myhost $PWD \$ '
  656.  
  657. to get, e.g. 
  658.  
  659. bengsig@ieibm1 /u/bengsig $
  660.  
  661. In the C-shell, use:
  662.  
  663. % set myhost=`hostname`
  664. % alias cd 'chdir \!* > /dev/null; set prompt="$LOGNAME@$myhost $cwd % "'
  665. % cd
  666.  
  667. to get, e.g.
  668.  
  669. bengsig@dkunix9 /u/bengsig/aixfaq %
  670.  
  671. There is no easy solution in the Bourne Shell.  Use the Korn Shell instead.
  672.  
  673.  
  674. 1.401: How do I set up ksh for emacs mode command line editing?
  675. From: scotte@cdsac.uucp (L. Scott Emmons)
  676.  
  677. The ksh has an undocumented way of binding the arrowkeys to the emacs
  678. line editing commands. In your .kshrc, add:
  679.  
  680. alias __A=^P
  681. alias __B=^N
  682. alias __C=^F
  683. alias __D=^B
  684. alias __H=^A
  685.  
  686. Note that "^P" (et al) must be the actual control sequence.
  687.  
  688. Type "set -o emacs" or put this line in your .profile.
  689.  
  690. Also, you MUST have PTF U406855 for this to work in AIX 3.2.  The APAR #
  691. for the problem is IX25982, which may have been superseded.
  692.  
  693.  
  694. 1.402: Listing files with ls causes a core dump
  695. From: John F Haugh II
  696.  
  697. Scenario: a directory that is shared by N users (N >= 200).
  698. Run 'ls -l' in that directory.  It goes for a while, then
  699. Seg fault(coredump)!
  700.  
  701. It only occurs when the usernames are displayed (almost every file is
  702. owned by a different person).  The -g and -n options work fine; only -l
  703. and -o (which shows owner and not group) cause it. 
  704.  
  705. I believe that this problem was corrected by U407548.  If you have that
  706. many users that you are having core dump problems (it took over 200),
  707. you might also want to look into getting the PTF that fixes IX31403. 
  708. That APAR deals with large numbers of accounts and performance problems
  709. associated with looking them up.
  710.  
  711.  
  712. 1.403: How do I put my own text into InfoExplorer?
  713.  
  714. With AIX 3.1, you cannot do it.  AIX 3.2 has a product called
  715. InfoCrafter that allows you to do that.
  716.  
  717.  
  718. 1.404: InfoExplorer ASCII key bindings 
  719. From: mycroft@hal.gnu.ai.mit.edu (Charles Hannum)
  720.  
  721. If you just press 'Return' when it starts up, with 'Basic Screen
  722. Operations' highlighted, you'll get some help.
  723.  
  724. If you look long enough, you'll find a page named 'Using Keys and Key
  725. Sequences in the InfoExplorer ASCII Interface'.  It describes the key
  726. sequences and actions.  Here are a few to get you started.
  727.  
  728. Keys       Action
  729.  
  730. Ctrl-W     Moves between the Navigation screen and the Reading screen.
  731. If the Navigation screen is displayed, you can press Ctrl-W to display
  732. the Reading screen.  If the Reading screen is displayed, you can press
  733. Ctrl-W to display the Navigation screen.
  734.  
  735. Ctrl-O     Makes the menu bar active or inactive.  If your text cursor is
  736. located in the text area of the screen, you can press Ctrl-O to make the
  737. menu bar active.  If the menu bar is already active, you can press
  738. Ctrl-O to make it inactive, which moves the text cursor to the text area.
  739.  
  740. Tab     Moves to the next menu bar option in the menu bar.  If a pull-down
  741. menu is not displayed and you press the Right Arrow key, the next menu
  742. bar option is displayed in reverse video.
  743.  
  744.  
  745. 1.405: How can I add new man pages to the system?
  746. From: horst@faui63.informatik.uni-erlangen.de (Horst Luehrsen)
  747.  
  748. Put the man pages in /usr/man, e.g. /usr/man/man1/tcsh.1 for the tcsh
  749. man page.  Unter AIX 3.1.10, /usr/lib/makewhatis can be used to update
  750. the makewhatis-database /usr/man/whatis so apropos and whatis know about
  751. the added manpages.  /usr/lib/makewhatis should be available on all 3.2
  752. versions.
  753.  
  754. ______________________________________________________________________________
  755. 1.500  Which release of X11 do I have?
  756.  
  757. Run 'lslpp -h X11rte.obj'.
  758. If your output has a line similar to:
  759.  
  760.             01.02.0000.0000 COMPLETE   COMMIT     03/04/93   02:05:11 root
  761.  
  762. you have X11 R4. If your output has a line similar to:
  763.  
  764.     U491068 01.02.0003.0000 COMPLETE   COMMIT     07/28/93   12:50:42 root
  765.  
  766. you have X11 R5. Some people also call these AIXwindows 1.2.0 and 1.2.3.
  767.  
  768.  
  769. 1.501: How to prevent ctrl-alt-backspace from killing the X session
  770.  
  771. Start X with 'xinit -T' to disable ctrl-alt-backspace from stopping X.
  772.  
  773.  
  774. 1.502: Who has a termcap/terminfo source for the HFT console?
  775.  
  776. The console used on the RISC System/6000, PS/2 and RT can be used as a
  777. terminal on another system with the termcap below.  You can find this
  778. and other termcaps in /lib/libtermcap/termcap.src, including IBM
  779. specific ones.  The terminfo sources are stored in /usr/lib/terminfo/*.ti.
  780. This termcap can also be used from an aixterm window.
  781.  
  782. hf|hft|hft-c|ibm8512|ibm8513|IBM_High_Function_Terminal:\
  783.     :co#80:li#25:am:ht:\
  784.     :cm=\E[%i%d;%dH:ti=\E[25;1H:te=\E[20h:\
  785.     :nd=\E[C:up=\E[A:do=^J:ho=\E[H:\
  786.     :bs:sf=\E[S:ec=\E[%dX:\
  787.     :cl=\E[H\E[J:cd=\E[J:ce=\E[K:\
  788.     :AL=\E[%dL:DL=\E[%dM:al=\E[L:dl=\E[M:\
  789.     :im=\E[4h:ei=\E[4l:mi:\
  790.     :dm=\E[4h:ed=\E[4l:\
  791.     :so=\E[7m:se=\E[m:ul=\E[4m:ue=\E[m:\
  792.     :md=\E[1m:mr=\E[7m:mb=\E[5m:me=\E[m:\
  793.     :as=^N:ae=^O:sc=\E[s:rc=\E[u:\
  794.     :kl=\E[D:kb=^H:kr=\E[C:ku=\E[A:kd=\E[B:kh=\E[H:\
  795.     :kn#10:k1=\E[001q:k2=\E[002q:k3=\E[003q:k4=\E[004q:k5=\E[005q:\
  796.     :k6=\E[006q:k7=\E[007q:k8=\E[008q:k9=\E[009q:k0=\E[010q:\
  797.     :is=\Eb\E[m^O\E[?7h:rs=\Eb\E[m^O\E[?7h\E[H\E[J:
  798.  
  799.  
  800. 1.503: How can I look at PostScript files?  Why is "dpsexec" so lousy?
  801. From Marc Pawliger (marc@sti.com)
  802.  
  803. showps comes with the 1.2.3 (X11R5) version of the X11rte.ext.obj LPP.
  804. Very nice PS file previewer from Adobe.  Replaces xpsview which came
  805. with pre-1.2.3 Installed as /usr/lpp/DPS/showps/showps
  806.  
  807. From: VRBASS@ATLVMIC1 (Vance R. Bass)
  808.  
  809. You can look at PostScript files using either "xpreview" (in the
  810. optionally installable text formatting services) or you can get
  811. Ghostscript and Ghostview from a comp.sources.x server and build it
  812. yourself.
  813.  
  814. >From the "xpreview" man page:
  815. The xpreview command is an AIXwindows 1.2- and Motif 1.1-based
  816. application that displays output from the troff command on an AIXwindows
  817. display.  The troff command output file must be prepared for any one of
  818. the devX100, devX100K or devpsc devices.  The xpreview command also
  819. displays PostScript language files that begin with %!.
  820.  
  821. "dpsexec" is NOT intended to be a full-service document browser, but
  822. rather a simple DPS code debugger.  If you insist on using it, you can
  823. edit your PS code to remove the "showpage" (which will reset dpsexec
  824. and clear the window) to view single-page files.  It does not handle
  825. multi-page files gracefully.
  826.  
  827.  
  828. 1.504: unix:0 vs `hostname`:0
  829.  
  830. 1.) Is there any way to get the machine to check its local host table
  831.     first without renaming resolv.conf?
  832.  
  833. From: mcguire@selway.umt.edu (Charles J McGuire)
  834.  
  835.   Not that I know of.  Under SunOS and Ultrix you can specify, check
  836.   /etc/hosts, then NIS, then DNS.  On our AIX machines, I have a cron job
  837.   that checks the integrity of both the primary and secondary
  838.   nameservers every 5 minutes.  If they're gone, cron renames
  839.   resolv.conf.  It continues to check the servers.  When they're back,
  840.   it moves resolv.conf back.  Even with this arrangement, I need to
  841.   configure two resolv.conf files that switch the order of the primary
  842.   and secondary servers if the primary goes away.  If the primary is
  843.   unavailable, queries can still take a while to time out on the
  844.   primary, before querying the secondary.  This method is not very
  845.   elegant, but it does the job.  Things are a little unstable during the
  846.   transitions depending on when the servers go away relative to when
  847.   cron runs - not to mention slight differences in clock times.
  848.  
  849. 2.) How do you tell X applications where you are if the console display 
  850.     is unix:0?
  851.  
  852. From: crow@waterloo.austin.ibm.com (David L. Crow)
  853.  
  854.   I would suggest that if you have R5, use ":<display>.<screen>".  I do
  855.   not believe that R4 clients will understand :0, so I would suggest
  856.   unix:0 for them.
  857.  
  858.   Without specifying unix or the hostname, you will get the fastest
  859.   transport mechanism.  While currently there are only two transport
  860.   methods in the AIXwindows X server (Unix sockets and TCP sockets),
  861.   many vendors are looking at using shared memory as a transport method. 
  862.   If you use :0 (or :0.0 or :1, etc.), then you should get the best
  863.   performance regardless of the available transport methods.
  864.  
  865. From Marc Pawliger (marc@sti.com)
  866.   Using "unix:0" or "hostname:0" when the X11 Shared Memory Transport
  867. (SMT) is installed as part of the 1.2.3 X11rte.obj (X11R5) will incur
  868. a penalty vs. using ":0" See /usr/lpp/X11/README.SMT
  869.  
  870. 3.) Is there a significant performance penalty incurred by using
  871.     `hostname`:0 as DISPLAY?
  872.  
  873.   Yes! Using unix:0, you are using Unix sockets.  These are much faster
  874.   than their TCP socket counterparts.
  875.  
  876.  
  877. 1.505: VT100 key bindings for aixterm
  878. From: haedener@iac.unibe.ch (Konrad Haedener)
  879.  
  880. Add this to your .Xdefaults file and start your VAX session with
  881. 'aixterm -v -name vt100 -e telnet MYVAXHOST'
  882.  
  883. -----
  884. vt100.foreground: Wheat
  885. vt100.background: MidnightBlue
  886. vt100.font: Rom14.500
  887. vt100.geometry: 80x25+0+0
  888. vt100.vt102: true
  889. vt100.fullcursor: false
  890. vt100.pointerColor: coral
  891. vt100.cursorColor: gray100
  892. vt100.translations:    <Key>F1: string(0x1b) string("OP") \n\
  893.                        <Key>F2: string(0x1b) string("OQ") \n\
  894.                        <Key>F3: string(0x1b) string("OR") \n\
  895.                        <Key>F4: string(0x1b) string("OS") \n\
  896.                        <Key>KP_0: string(0x1b) string("Op") \n\
  897.                        <Key>KP_1: string(0x1b) string("Oq") \n\
  898.                        <Key>KP_2: string(0x1b) string("Or") \n\
  899.                        <Key>KP_3: string(0x1b) string("Os") \n\
  900.                        <Key>KP_4: string(0x1b) string("Ot") \n\
  901.                        <Key>KP_5: string(0x1b) string("Ou") \n\
  902.                        <Key>KP_6: string(0x1b) string("Ov") \n\
  903.                        <Key>KP_7: string(0x1b) string("Ow") \n\
  904.                        <Key>KP_8: string(0x1b) string("Ox") \n\
  905.                        <Key>KP_9: string(0x1b) string("Oy") \n\
  906.                        <Key>KP_Divide: string(0x1b) string("OQ") \n\
  907.                        <Key>KP_Multiply: string(0x1b) string("OR") \n\
  908.                        <Key>KP_Subtract: string(0x1b) string("OS") \n\
  909.                        <Key>KP_Add: string(0x1b) string("Om") \n\
  910.                        <Key>KP_Enter: string(0x1b) string("OM") \n\
  911.                        <Key>KP_Decimal: string(0x1b) string("On") \n\
  912.                        <Key>Next: string(0x1b) string("Ol") \n\
  913.                        <Key>Left: string(0x1b) string("OD") \n\
  914.                        <Key>Up: string(0x1b) string("OA") \n\
  915.                        <Key>Right: string(0x1b) string("OC") \n\
  916.                        <Key>BackSpace : string(0x7f) \n\
  917.                        <Key>Down: string(0x1b) string("OB")
  918.  
  919. You should also add
  920.  
  921. XENVIRONMENT=$HOME/.Xdefaults
  922. export XENVIRONMENT
  923.  
  924. to your .profile.
  925.  
  926.  
  927. 1.506: Is there a screen saver that does not use excessive CPU?
  928.  
  929. From: buchholz@ese.ogi.edu (Don Buchholz)
  930.  
  931. Try using xlock with these options:
  932.  
  933.     xlock -mode life -count 1500 -nice 20 -root
  934.  
  935.  
  936. From: pranav@evolving.com (Pranav Vakil)
  937.  
  938. Use mlock -hide to hide the background. You can also modify the mlock
  939. (/usr/local/tools/mlock) code to allow the standard X screen saver to
  940. take effect. The timeout value is originally set to 0 which means the
  941. screen saver is off. Modify this to be 120 (2 minutes) and set the
  942. interval time to be 60 (1 minute). Using these intervals, I have found
  943. that over a 24 hour period, it uses only .3 cpu minutes.
  944.  
  945. ______________________________________________________________________________
  946. 1.600: My named dies frequently, why?
  947.  
  948. Running on 3.2, named dies frequently on network's primary name server.
  949.  
  950. From: jpe@ee.egr.duke.edu (John P. Eisenmenger)
  951.  
  952. Try the following:
  953.  
  954.      stopsrc -s named        # stop running named
  955.      setenv MALLOCTYPE 3.1    # use 3.1 memory allocation algorithm
  956.      /etc/named ...        # don't use smit to start named
  957.  
  958. You might be able to use startsrc/smit after setting MALLOCTYPE and get
  959. the same effect, but I'm not sure.
  960.  
  961. [According to John, the problem is malloc() in the named code. He
  962.  also suggests using Berkeley's bind, which he has ported and can be
  963.  ftp'ed from ftp.egr.duke.edu, /archives/network/bind-4.8.3.tar.Z. -ed]
  964.  
  965. Two ptfs should fix this problem. Get U412332 and U414752.
  966.  
  967. Christophe Wolfhugel <Christophe.Wolfhugel@grasp.insa-lyon.fr> reports
  968. that bind 4.9 works fine on AIX 3.2 and without MALLOCTYPE=3.1.
  969.  
  970.  
  971. 1.601: How do I trace ethernet packets on an AIX system?
  972. From: afx@muc.ibm.de (Andreas Siegert)
  973.  
  974. Do the following:
  975.  
  976.      iptrace -i en0 /tmp/ipt
  977.  
  978. The iptrace backgrounds.  Find its process id and kill it when you are
  979. ready.  Then run
  980.  
  981.      ipreport -rns /tmp/ipt >/tmp/ipr
  982.  
  983. and look at the output.  The current version of Info does not document
  984. the r, n and s options but they are quite useful for layering the output.
  985.  
  986.  
  987. 1.602 What is the authorized way of starting automount at boot time?
  988. From: curt@ekhadafi.austin.ibm.com (Curt Finch)
  989.  
  990. I put this in my /etc/inittab:
  991.  
  992. automount:2:once:/usr/etc/automount -T -T -T -v >/tmp/au.se 2>&1
  993.  
  994. I hereby dub it authorized.
  995.  
  996.  
  997. 1.603: How do I set a tty port for both dial-in and dial-out?
  998.  
  999. Set the mode of the tty to be either 'shared' or 'delayed'. 
  1000.  
  1001.  
  1002. 1.604: How to move or copy whole directory trees across a network
  1003.  
  1004. The following command will move an entire directory tree across a network 
  1005. while preserving permissions, uids and gids.
  1006.  
  1007.       $rsh RemoteHost "cd TargetDir; tar -cBf - ." | tar -xvBf -
  1008.  
  1009. Explanation:
  1010.  
  1011. The tar-create is rsh'd to the remote system and is written to
  1012. stdout (the pipe).
  1013.  
  1014. The local system is extracting the tar that is being read from
  1015. stdin (the pipe).
  1016.  
  1017.  
  1018. 1.605: How can I send mail to hosts that cannot be pinged?
  1019. From: jupiter.sun.csd.unb.ca!dedourek (John DeDourek)
  1020.  
  1021. AIX 3.2 as shipped is configured to only send mail to mail addresses
  1022. which include a host name.  Many organizations use a mail address whose
  1023. "host name" part is not a host name (technically an MX name).  To change
  1024. the configuration of the AIX mailer, login as root.  Then edit the file
  1025. /etc/sendmail.cf to remove the comment marker ("# ") at the beginning of
  1026. the line which reads:
  1027.     # OK MX
  1028.  
  1029. Now rebuild the machine readable form of the configuration with
  1030.     sendmail -bz
  1031.  
  1032. and finally restart signal sendmail to load the new configuration by one
  1033. of the following:
  1034.      reboot
  1035. or
  1036.      stopsrc -s sendmail
  1037.      startsrc -s sendmail
  1038. or 
  1039.      kill -1 `cat /etc/sendmail.pid`
  1040.  
  1041.  
  1042. 1.606: How to configure dialup SLIP
  1043. From: marvin@tornado.oche.de (Christian Bode)
  1044.  
  1045. If you don't have problems with slattach you should have PTF 
  1046. bos.obj 3.2.0.0.U411505 installed.  I assume that you did the right
  1047. ifconfig commands to setup your slip-device (for example sl0).
  1048.  
  1049. 1. Create a group called slip.
  1050.  
  1051. 2. Create a user slip with smit like this:
  1052.                                                      [Entry Fields]
  1053. * User NAME                                          [slip]
  1054.   ADMINISTRATIVE User?                                true
  1055.   User ID                                            []
  1056.   LOGIN user?                                         true
  1057.   PRIMARY group                                      [slip]
  1058.   Group SET                                          [slip]
  1059.   ADMINISTRATIVE groups                              [system]
  1060.   SU groups                                          [slip]
  1061.   HOME directory                                     [/home/slip]
  1062.   Initial PROGRAM                                    [/bin/sh]
  1063.   User INFORMATION                                   [SLIP-Dialup]
  1064.   Another user can SU to user?                        false
  1065.   User can RLOGIN?                                    true
  1066.   TRUSTED PATH?                                       nosak
  1067.   Valid TTYs                                         [/dev/tty1]
  1068.   AUDIT classes                                      []
  1069.   PRIMARY authentication method                      [SYSTEM]
  1070.   SECONDARY authentication method                    [NONE]
  1071.   Max FILE size                                      [2097151]
  1072.   Max CPU time                                       [-1]
  1073.   Max DATA segment                                   [262144]
  1074.   Max STACK size                                     [65536]
  1075.   Max CORE file size                                 [2048]
  1076.   Max physical MEMORY                                [65536]
  1077.   File creation UMASK                                [022]
  1078.   EXPIRATION date (MMDDhhmmyy)                       [0]
  1079.  
  1080. 3. Create a tty with getty on it:
  1081.                                    Add a TTY
  1082.                                                [Entry Fields]
  1083.   TTY type                                     tty
  1084.   TTY interface                                rs232
  1085.   Description                                  Asynchronous Terminal
  1086.   Parent adapter                               sa0
  1087. * PORT number                                  [s1]
  1088.   BAUD rate                                    [38400]
  1089.   PARITY                                       [none]
  1090.   BITS per character                           [8]
  1091.   Number of STOP BITS                          [1]
  1092.   TERMINAL type                                [dumb]
  1093.   STATE to be configured at boot time          [available]
  1094.   DMA                                          on
  1095.   Read Trigger                                 0,1,2,3
  1096.   Transmit buffer count                        [16]
  1097.   Name of initial program to run               [/etc/getty]
  1098.  
  1099.   Note: The following attributes are only applicable if /etc/getty is
  1100.         specified as the initial program to run.
  1101.  
  1102.   Enable program?                              respawn
  1103.   Run level                                    2
  1104.   Enable LOGIN                                 share
  1105.   TIME before advancing to next port setting   [0]
  1106.   STTY attributes for RUN TIME                 [hupcl,cread,brkint>
  1107.   STTY attributes for LOGIN                    [hupcl,cread,echoe,>
  1108.   RUN shell activity manager                   no
  1109.   Optional LOGGER name                         []
  1110.  
  1111. 4. Change the hardware characteristics so that it uses NO XON/XOFF handshake
  1112.  
  1113. 5. Here is the the .profile for User slip to manage dialups
  1114.  
  1115. PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/local/bin:.
  1116.  
  1117. ENV=$HOME/.kshrc
  1118. HISTSIZE=128
  1119.  
  1120. export PATH ENV HISTSIZE
  1121. #
  1122. # Search for a LCK-File for our tty if there is one
  1123. #
  1124.  
  1125. if test -f /etc/locks/LCK..tty1
  1126. then
  1127.   SHPID=`cat /etc/locks/LCK..tty1`
  1128. else
  1129.  echo `date` " No LCK-File !!!" >>slip.log
  1130.  exit 64
  1131. fi
  1132.  
  1133. #
  1134. # Search for our own Shell to get the PID for checking against LCK-File
  1135. #
  1136.  
  1137. SH2PID=`ps -aef |
  1138.         sed -n -e 's/^ *slip  *\([0-9][0-9]*\) .*-sh *$/\1/p`
  1139.  
  1140. #
  1141. # Is it the the same PID as in the LCK File so that we can start working ??
  1142. #
  1143.  
  1144. if test $SHPID = $SH2PID
  1145. then
  1146. #  remove the LCK-File because slattach does not like it.
  1147.    rm -rf /etc/locks/LCK..tty1
  1148. #  Add RTS/CTS Handshakeing to our own tty
  1149.    stty add rts
  1150. #  Startup slattach. Slattach has to have mode 4755 to be started up !!!
  1151.    /usr/sbin/slattach tty1
  1152. #  Just say that we are up.
  1153.    echo `date` " Starting up slip-daemon " >>slip.log
  1154. #  leave slattach enough time to startup
  1155.    sleep 4
  1156. else
  1157. # Something must be wrong with the LCK-File
  1158.   SH3PID=`ps -aef | awk ' {print $2}' | grep $SHPID`
  1159.  
  1160.   if test ."$SH3PID" = .""
  1161.   then
  1162.     SH3PID="NO_SUCH_PROCESS"
  1163.   fi
  1164.  
  1165.   if test $SHPID = $SH3PID
  1166.     then
  1167. #  There is a living process which owns the LCK-File !!
  1168.        echo `date` " Can't remove LCK-File, not owner !!!" >>slip.log
  1169.        exit 64
  1170.     else
  1171. #   Who the hell didn't remove the LCK-File (should never happen)
  1172.        echo `date` " LCK-File with no owner found !!!" >>slip.log
  1173.        exit 64
  1174.     fi
  1175. fi
  1176.  
  1177. # Get the pid of slattch so that we can kill him later on.
  1178. SLPID=`ps -aef |
  1179.  sed -n -e 's/^ *slip  *\([0-9][0-9]*\) .*-.*\/usr\/sbin\/slattach tty1 *$/\1/p`
  1180.  
  1181. # Kill slattach if we get a signal 1 (Carrier Lost ? / Otherside-slattach
  1182.   terminated )
  1183. trap "kill $SLPID; exit 0" 1
  1184.  
  1185. # We  will have a nice sleep and nice dreamings
  1186. while sleep 256
  1187. do
  1188. :
  1189. done
  1190.  
  1191. Here's another scenario:
  1192. From: oosten@angelo.ee.ualberta.ca (Brian Oostenbrink)
  1193.  
  1194. Operating System: IBM AIX 3.2.1 and 3.2.3
  1195.  
  1196. Configuring two RS6000s via a Serial Line Interface Protocol (SLIP) 
  1197. connection over two US Robotics Sportster 14,400 modems.
  1198.  
  1199. The AIX implementation of SLIP is slightly different from most others. 
  1200. The ifconfig command is used to bring up a serial interface, and the
  1201. slattach command is used to connect the interface to the serial port
  1202. used for the connection.  Dialer device commands can also be issued when
  1203. invoking the slattach command, using UUCP chat syntax.
  1204.  
  1205. The following describes a connection between two machines:
  1206.  
  1207.      local.j.k.l
  1208.          ethernet IP address 129.128.127.21
  1209.          slip interface IP address 129.1.2.1
  1210.  
  1211.      remote.a.b.c
  1212.          ethernet IP address 129.11.22.44
  1213.          slip interface address 129.11.22.1
  1214.  
  1215. 1. Interface configuration
  1216.  
  1217. Each machine must have a separate IP address dedicated to the SLIP
  1218. interface. On remote.j.k.l, start the SLIP interface with:
  1219.  
  1220.          ifconfig sl0 129.11.22.1 129.128.127.1  up
  1221.  
  1222. and on local.a.b.c:
  1223.  
  1224.          ifconfig sl0 129.128.127.1 129.11.22.1  up
  1225.  
  1226. It is important in later versions of AIX 3.2.3+ to use the same SLIP
  1227. interface # as the ptty port #, ie. if you use tty12, use ifconfig sl12
  1228. instead of sl0.
  1229.  
  1230. At this point the interfaces are ready to be connected.
  1231.  
  1232. 2. tty configuration
  1233.    The tty ports on both machines were configured in an identical manner
  1234.    using smit.
  1235.                                                  [Entry Fields]
  1236.  TTY type                                           tty
  1237.  TTY interface                                      rs232
  1238.  Description                                        Asynchronous Terminal
  1239.  Parent adapter                                     sa0
  1240.  PORT number                                        []                       +
  1241.  BAUD rate                                          [38400]                  +
  1242.  PARITY                                             [none]                   +
  1243.  BITS per character                                 [8]                      +
  1244.  Number of STOP BITS                                [1]                      +
  1245.  TERMINAL type                                      [dumb]
  1246.  STATE to be configured at boot time                [available]              +
  1247.  DMA                                                on                       +
  1248.  Read Trigger                                       0,1,2,3
  1249.  Transmit buffer count                              [16]                      #
  1250.  Name of initial program to run                     [etc/getty]
  1251.  
  1252.  Note: The following attributes are only applicable if /etc/getty is specified
  1253.  as the initial program to run.
  1254.  
  1255.  Enable program?                                    respawn
  1256.  Run level                                          2
  1257.  Enable LOGIN                                       disable                  +
  1258.  TIME before advancing to next port setting         [0]                      +#
  1259.  STTY attributes for RUN TIME                       [hupcl,cread,brkint,icr>
  1260.  STTY attributes for LOGIN                          [hupcl,cread,echoe,cs8,>
  1261.  RUN shell activity manager                         no                       +
  1262.  Optional LOGGER name                               []
  1263.  
  1264. On older versions of AIX, we encountered some problems disabling getty, and
  1265. resorted to changing the /etc/inittab file directly. For example, change
  1266.  
  1267.    tty0:2:respawn:/etc/getty /dev/tty0
  1268. to
  1269.    tty0:2:off:/etc/getty /dev/tty0
  1270.  
  1271. This will disable getty from running. After creating the SLIP tty device,
  1272. you will need to change its hardware configuration to disable Xon/Xoff
  1273. flow control. Software flow control should not be used for SLIP. Type
  1274. 'smit chtty', and then select sub item 2: Hardware settings.
  1275.  
  1276. Most of the parameters in the tty configuration are the defaults.
  1277.  
  1278. 3. Modem Configuration
  1279.  
  1280.    The modems were configured as follows:
  1281.  
  1282.    RTS/CTS flow control enabled.
  1283.    Xon/Xoff software flow control disabled. Usually this is automatic if
  1284.       RTS/CTS is enabled.
  1285.    Data rate, terminal to modem = fixed.
  1286.       This is the baud rate from the tty port to the modem. We used a
  1287.       fixed modem-port transfer rate, set to the fastest speed supported
  1288.       by both the tty port and the modem. Newer modems can use a higher
  1289.       transfer rate between the modem and serial port than the modem to
  1290.       modem rate, which is necessary to use data compression effectively.  
  1291.       In our setup, we used 14.4 kBaud modems with a port speed of 38.4
  1292.       kBaud. If your modem supports this feature, use it, otherwise set
  1293.       the port speed equal to the modem connection rate. On the USR
  1294.       Sportster at&b1 fixes the serial port rate to that of the last
  1295.       AT command. The speed parameter of the slattach command can be
  1296.       used to ensure that this rate is that set in the tty configuration.
  1297.    Error Correction enabled - not mandatory, but a good idea
  1298.    Data Compression - not required, but it helps, especially for text
  1299.       transfers.
  1300.    Auto Answer - If the SLIP connection is to be initiated from either
  1301.       machine, both modems should be set to auto answer, otherwise, just
  1302.       the answering modem.
  1303.  
  1304.    It is a good idea to configure the modem and then save the settings
  1305.    to NVRAM, so that the correct settings can always be restored by the
  1306.    slattach command.
  1307.  
  1308. 4. UUCP configuration files
  1309.  
  1310.    /usr/lib/uucp/Devices
  1311.    /usr/lib/uucp/Dialers
  1312.  
  1313.    The Devices file must contain an entry with the tty and serial port
  1314.    speed used for the interface. In our example,
  1315.       Direct tty0 38400 slipdialer
  1316.  
  1317.    The keyword 'slipdialer' is merely an index into the Dialers file.
  1318.    For our purposes, the slipdialer entry in the Dialers file is simply:
  1319.  
  1320.       slipdialer
  1321.  
  1322.    This entry can also contain UUCP chat commands, or the chat commands
  1323.    can be included in the slattach command.
  1324.  
  1325. 5. slattach invocation
  1326.  
  1327.    slattach connects the device on the tty port to the SLIP interface
  1328.    created by ifconfig, and sends any commands to the tty device if
  1329.    needed. For our example, remote.j.k.l would never initiate a call,
  1330.    only answer incoming calls. Therefore we execute:
  1331.  
  1332.          slattach tty0 38400 '"" ATZ OK ""'
  1333.  
  1334.    which connects the tty at 38400 baud. We could also simply run
  1335.  
  1336.          slattach tty0
  1337.  
  1338.    ie. without any modem commands, but the modem to port speed may not
  1339.    be correctly set this way. In addition, the ATZ command ensures the
  1340.    modem is set to the NVRAM settings.
  1341.  
  1342.    On local.a.b.c type:
  1343.  
  1344.          slattach tty0 38400 '"" ATZ OK \pATDT4925871 BIS ""' 4
  1345.  
  1346.    This establishes the link at 38400 baud, and executes the dial string
  1347.    as shown. The dial string is a UUCP chat string and are configured
  1348.    in an expect send expect send ... format. The string:
  1349.  
  1350.          '"" ATZ OK \pATDT4925871 BIS ""'
  1351.  
  1352.    is interpreted as:
  1353.    expect "" (null string) from modem
  1354.    send   ATZ              to modem
  1355.    expect OK               from modem
  1356.    send   \pATDT4925871    to modem
  1357.    expect BIS              from modem
  1358.  
  1359.    BIS is the end of the CONNECT STRING. You could use any portion of
  1360.    the string returned by the modem upon a connection as the expect
  1361.    string. It may be wiser to simply expect CONNECT since all
  1362.    connections should return this string.
  1363.    The null strings are necessary because the first parameter of the
  1364.    UUCP is an expected string from the modem, which can only be a null
  1365.    string until the modem has been given a command.
  1366.  
  1367.    The last parameter (4) of the slattach command is the debug level. 
  1368.    A debug level of 4 displays the UUCP chat strings, which is useful
  1369.    for checking the modem status.
  1370.  
  1371. 6. Routing
  1372.    ifconfig is sufficient if all you want to do is talk between the
  1373.    two hosts.  If you are running SLIP so that you can talk to more
  1374.    than just that one other host you have to advertise your address.
  1375.    
  1376.    1) arp -s 802.5 iago 10:00:5a:b1:49:d8 pub
  1377.         where 802.5 is a token-ring network the hardware address can
  1378.         be obtained with `netstat -v` and iago was the SLIP client (My
  1379.         PC at home :)  pub is the important part it means "published"
  1380.         You may want to run this at boot time. 
  1381.  
  1382.    Routing through the SLIP link is similiar to routing of any gateway. 
  1383.    Invoking the ifconfig command automatically sets up a route between
  1384.    the two SLIP machines. An entry in /etc/hosts or the named database
  1385.    should be made, with the same machine name used for the SLIP address
  1386.    as the ethernet address on each machine. For example, in /etc/hosts
  1387.    on remote.a.b.c (and any other machine on remote.a.b.c ethernet):
  1388.  
  1389.      129.11.22.44 remote.a.b.c # ethernet address
  1390.      129.11.22.1  remote.a.b.c # slip address
  1391.  
  1392.    It is preferable to place the ethernet address in the hosts file
  1393.    before the SLIP address so remote.a.b.c will resolve to the
  1394.    ethernet address. When using named, it is important to have both
  1395.    addresses in the reverse file with the same name. We experienced
  1396.    difficulties with NFS mounting over the slip link, owing to some
  1397.    machine interpreting NFS requests from one of the two SLIP machines
  1398.    as coming from the SLIP address, while the SLIP machine believed it
  1399.    was sending the request from the ethernet address. This problem was
  1400.    eliminated by having both addresses reverse resolve to the same name.
  1401.  
  1402. 7. Performance
  1403.    At a modem speed of 14.4 kBaud and a port speed of 38.4 kBaud, we
  1404.    realized a transfer rate through ftp of about 3.5 kB/s for text
  1405.    files, and 1.3 kB/s for compressed files.
  1406.  
  1407.  
  1408. 1.607: Where is DCE discussed?
  1409. From: brent@uwovax.uwo.ca (Brent Sterner)
  1410.  
  1411. DCE is the Distributed Computing Environment, which is roughly a
  1412. flexible client-server architecture for heterogenous platforms.
  1413. For more information, take a look in comp.unix.osf.misc. 
  1414.  
  1415.  
  1416. 1.608: How do I make /var/spool/mail mountable?
  1417. From: petersen@pi1.physik.uni-stuttgart.de (Joerg Petersen)
  1418.  
  1419. In our cluster we share a /usr/local disk. We have a directory
  1420. /usr/local/spool/mail and /var/spool/mail is soft-linked to it.
  1421.  
  1422. From: fred@hal6000.thp.Uni-Duisburg.DE (Fred Hucht)
  1423.  
  1424. Several problems has been reported on sharing the mail directory via
  1425. NFS. The problems may occur when two or more sendmail daemons and/or
  1426. mail readers access a user's mail file simultanously, because of NFS'
  1427. file locking mechanism.
  1428.  
  1429. We use another method here: Every user has one line in his/her
  1430. $HOME/.forward file that reads
  1431.  
  1432. xxx@mainserver.domain.name
  1433.  
  1434. where xxx is the user node and mainserver.domain.name is the full
  1435. hostname of one of the machines. Then all incoming mail to all machines
  1436. is forwarded to mainserver, while mainserver ignores this line.
  1437.  
  1438.  
  1439. 1.609: getty spawning too rapidly 
  1440. thanks to aslam@abaseen.lums.edu.pk (Sohail Aslam)
  1441.  
  1442. The problem can occur due a number of modem settings. The most
  1443. frequent is that the echo is not disabled on modems that are to
  1444. accept incoming calls. In hayes language, ATE0 disables echo.
  1445. If echo is enabled, the login prompt sent by the DTE (computer)
  1446. is echoed back to it. It then issues "password:" prompt which
  1447. the modem conveniently echoes back again. And the cycle goes on.
  1448.  
  1449. Another setting to check is the Q registers which controls the
  1450. modem's response to the DTE. The hayes command ATQ0 enables
  1451. results codes. The Q register in conjunction with the X and
  1452. the V registers, reports back to the DTE the status of the incoming
  1453. or outgoing call, and the type of connection established. For
  1454. outgoing calls, one would want to enable result codes but not
  1455. for incoming calls. If codes are enabled (via ATQ0), when a
  1456. call comes in, the modem will send strings (if ATV1 and ATX4 set)
  1457. "RINGING", "CONNECTED" etc. to the local DTE. The getty will think
  1458. some one is trying to login. It will send password prompt. Trouble
  1459. again. Telebit and other intelligent modems has ATQ2 setting
  1460. which says "reports codes only when calling out." For others,
  1461. you will need to disable it (ATQ1) and enable when calling out.
  1462.  
  1463. The DSR setting can be a source of problem. Ideally, modem should
  1464. raise DSR only when CD is detected and modem raises CTS. Computer,
  1465. such as the VAX, wait 30 seconds after the modem raises DSR. If
  1466. CD is not on by that time, the computer will drop DTR causing the
  1467. modem to reset. The DSR should be set to be raised only when
  1468. carrier has been detected. The hayes setting is AT&S1.
  1469.  
  1470. The DCD setting should be such that it reflects the true nature of
  1471. the carrier. The CD can be forced on at all times (AT&C0). This
  1472. is not good. Set it to AT&C1.
  1473.  
  1474. Most modems can reload saved settings from non-volatile memory
  1475. on a DTR transition. This is useful for resetting the modem
  1476. when a call drops. Use AT&D3 to get this effect. 
  1477.  
  1478. For dial in, thus, set AT E0 Q1 &C1 &D3 &S1 &W. The &W stores the
  1479. settings in memory. They will be reloaded due to &D3.
  1480.  
  1481.  
  1482. 1.610 Does AIX support Compressed SLIP (CSLIP)?
  1483.  
  1484. No.  That means no VJ compression either :)  See PPP in section 5.07 
  1485. if you want more than standard SLIP.
  1486.  
  1487.  
  1488. ______________________________________________________________________________
  1489. 1.900: SCSI-1 and SCSI-2 "interoperability" got you confused?
  1490. From: drr
  1491.  
  1492. A.  SCSI-1 devices are supported on a SCSI-2 adapter.  This
  1493.     config will provide SCSI-1 performance.
  1494.  
  1495. B.  SCSI-2 devices are supported on a SCSI-1 adapter.  This
  1496.     config will provide SCSI-1 performance.
  1497.  
  1498. C.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-1
  1499.     adapter.  All devices will have SCSI-1 performance.
  1500.  
  1501. D.  A mix of SCSI-2 and SCSI-1 devices are supported on a SCSI-2
  1502.     adapter.  SCSI-2 devices will have SCSI-2 performance (10 MB/sec)
  1503.     and SCSI-1 devices will have SCSI-1 performance (4-5 MB/sec).
  1504.  
  1505.  
  1506. 1.901: How to get your keyboard back after unplugging it from the 6000
  1507. From: Mickey Coggins and Anne Serre
  1508.  
  1509. When you unplug your keyboard from a running system, and plug it back
  1510. in, the key mapping is wrong.  For example, keys like Caps Lock and Ctrl
  1511. don't work as designed.
  1512.  
  1513. Solution: Type at the command line
  1514.  
  1515.         /usr/lpp/diagnostics/da/dkbd
  1516.  
  1517. Your screen goes black, you hear a few beeps, and your keyboard is reset.
  1518. It works with any environment, Xwindows, hft, NLS...
  1519.  
  1520. For Models 220, 230 and M20, use the following commands:
  1521.  
  1522. /usr/lpp/diagnostics/da/dkbd
  1523. /usr/lpp/diagnostics/da/dkbdsal   (for the 220)
  1524.  
  1525.  
  1526. 1.902: How do I set up pcsim, the DOS emulator?
  1527.  
  1528. You must have a bootable DOS diskette to install pcsim. Either DOS 3.3, 
  1529. 4.x, or 5.0 will work. IBM do not officially support DOS 5.0 for pcsim
  1530. but I have no problems with it. Just don't try to be fancy with the UMB 
  1531. and memory manager stuff.
  1532.  
  1533. With a bootable DOS disk in the drive, do:
  1534. $touch /u/dosdrive (this is the AIX file for DOS emulation)
  1535. $pcsim -Adiskette 3 -Cdrive /u/dosdrive
  1536. You would now get an A prompt. Type:
  1537. A> fdisk
  1538. Create the virtual C drive of whatever size you choose. Make it large 
  1539. enough for your needs since you cannot enlarge it later.
  1540. A> format c: /s (to format the virtual C drive)
  1541. Now exit from pcsim with ESCpcsim (Esc key followed by pcsim).
  1542.  
  1543. Now create a simprof file. Following is a starter:
  1544.  
  1545. Adiskette   : 3
  1546. Cdrive      :/u/dosdrive
  1547. lpt1        : name of printer queue
  1548. refresh     : 50
  1549. dmode       : V
  1550. mouse       : com1
  1551.  
  1552. You can now start pcsim anytime by typing pcsim. Make sure no floppies
  1553. are in the drive. For further information, refer to publication
  1554. SC23-2452, Personal Computer Simulator/6000 Guide and Reference.
  1555.        
  1556.  
  1557. 1.903: How do I transfer files between AIX and DOS disks?
  1558.  
  1559. In one of the bos extensions are commands for transferring files between
  1560. DOS diskettes and AIX. The commands are dosread, doswrite, dosdir, dosdel,
  1561. and dosformat. Many users have mentioned that the mtools package from
  1562. prep.ai.mit.edu is better than the native AIX programs.
  1563.  
  1564. _____________________________________________________________________________
  1565. 2.00: C/C++
  1566.  
  1567. Contrary to many people's belief, the C environment on the RS/6000 is
  1568. not very special.  The C compiler has quite a number of options that can
  1569. be used to control how it works, which "dialect" of C it compiles, how
  1570. it interprets certain language constructs, etc.  InfoExplorer includes a
  1571. Users Guide and a Reference Manual.
  1572.  
  1573. The compiler can be invoked with either xlc for strict ANSI mode and cc
  1574. for RT compatible mode (i.e. IBM 6150 with AIX 2).  The default options
  1575. for each mode are set in the /etc/xlc.cfg file, and you can actually add
  1576. another stanza and create a link to the /bin/xlc executable.
  1577.  
  1578. The file /usr/lpp/xlc/bin/README.xlc has information about the C
  1579. compiler, and the file /usr/lpp/bos/bsdport contains useful information,
  1580. in particular for users from a BSD background.
  1581.  
  1582. The file /etc/xlc.cfg also shows the symbol _IBMR2 that is predefined,
  1583. and therefore can be used for #ifdef'ing RS/6000 specific code.
  1584.  
  1585.  
  1586. 2.01: I cannot make alloca work
  1587.  
  1588. A famous routine, in particular in GNU context, is the allocation
  1589. routine alloca().  Alloca allocates memory in such a way that it is
  1590. automatically free'd when the block is exited.  Most implementations
  1591. does this by adjusting the stack pointer.  Since not all C environments
  1592. can support it, its use is discouraged, but it is included in the xlc
  1593. compiler.  In order to make the compiler aware that you intend to use
  1594. alloca, you must put the line
  1595.  
  1596. #pragma alloca
  1597.  
  1598. before any other statements in the C source module(s) where alloca is
  1599. called.  If you don't do this, xlc will not recognize alloca as anything
  1600. special, and you will get errors during linking.
  1601.  
  1602. For AIX 3.2, it may be easier to use the -ma flag.
  1603.  
  1604.  
  1605. 2.02: How do I compile my BSD programs?
  1606.  
  1607. The file /usr/lpp/bos/bsdport contains information on how to port
  1608. programs written for BSD to AIX 3.1.  This file may be very useful for
  1609. others as well.
  1610.  
  1611. A quick cc command for most "standard" BSD programs is:
  1612.   
  1613.   $ cc -D_BSD -D_BSD_INCLUDES  -o [loadfile] [sourcefile.c] -lbsd
  1614.  
  1615. If your software has system calls predefined with no prototype
  1616. parameters, also use the -D_NO_PROTO flag.
  1617.  
  1618.  
  1619. 2.03: Isn't the linker different from what I am used to?
  1620.  
  1621. Yes.  It is not at all like what you are used to:
  1622.  
  1623. - The order of objects and libraries is normally _not_ important.  The
  1624.   linker reads _all_ objects including those from libraries into memory
  1625.   and does the actual linking in one go.  Even if you need to put a
  1626.   library of your own twice on the ld command line on other systems, it
  1627.   is not needed on the RS/6000 - doing so will even make your linking slower.
  1628.  
  1629. - One of the features of the linker is that it will replace an object in
  1630.   an executable with a new version of the same object:
  1631.  
  1632.   $ cc -o prog prog1.o prog2.o prog3.o        # make prog
  1633.   $ cc -c prog2.c                # recompile prog2.c
  1634.   $ cc -o prog.new prog2.o prog            # make prog.new from prog
  1635.                         # by replacing prog2.o
  1636.   
  1637. - The standard C library /lib/libc.a is linked shared, which means that
  1638.   the actual code is not linked into your program, but is loaded only
  1639.   once and linked dynamically during loading of your program.
  1640.  
  1641. - The ld program actually calls the binder in /usr/lib/bind, and you can
  1642.   give ld special options to get details about the invocation of the
  1643.   binder.  These are found on the ld man page or in InfoExplorer.
  1644.  
  1645. - If your program normally links using a number of libraries (.a files),
  1646.   you can 'prelink' each of these into an object, which will make your
  1647.   final linking faster.  E.g. do:
  1648.  
  1649.   $ cc -c prog1.c prog2.c prog3.c
  1650.   $ ar cv libprog.a prog1.o prog2.o prog3.o
  1651.   $ ld -r -o libprog.o libprog.a
  1652.   $ cc -o someprog someprog.c libprog.o
  1653.  
  1654. This will solve all internal references between prog1.o, prog2.o and
  1655. prog3.o and save this in libprog.o Then using libprog.o to link your
  1656. program instead of libprog.a will increase linking speed, and even if
  1657. someprog.c only uses, say prog1.o and prog2.o, only those two modules
  1658. will be in your final program.  This is also due to the fact that the
  1659. binder can handle single objects inside one object module as noted above.
  1660.  
  1661. If you are using an -lprog option (for libprog.a) above, and still want
  1662. to be able to do so, you should name the prelinked object with a
  1663. standard library name, e.g. libprogP.a (P identifying a prelinked
  1664. object), that can be specified by -lprogP.  You cannot use the archiver
  1665. (ar) on such an object.
  1666.  
  1667. You should also have a look at section 3.01 of this article, in
  1668. particular if you have mixed Fortran/C programs.
  1669.  
  1670. Dave Dennerline (dad@adonis.az05.bull.com) claims that his experiences
  1671. in prelinking on AIX does not save much time since most people have
  1672. separate libraries which do not have many dependencies between them,
  1673. thus not many symbols to resolve.
  1674.  
  1675.  
  1676.  
  1677.